<template>
  <div class="box">
    <div class="form">
      <el-button type="primary" @click="postOne">保存</el-button>
      <el-table
        :data="tableData2"
        style="width: 100%"
        :header-cell-style="{
          textAlign: 'center',
          background: '#409eff',
          color: '#ffffff',
        }"
        border
        header-align="center"
        :cell-style="{ textAlign: 'center' }"
      >
        <el-table-column label="设备名称">预热罩</el-table-column>
        <el-table-column label="预热罩功耗(W)">
          <template slot-scope="scope">
            <el-input v-model.number="scope.row.yrzConsumUp"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="预热罩内温(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.yrzTempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.yrzTempDown"></el-input>
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column label="胎膜温度报警（℃ ）">
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.yrzGlassTempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.yrzGlassTempDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
      </el-table>
      <el-table
        :data="tableData2"
        style="width: 100%"
        border
        :cell-style="{ textAlign: 'center' }"
        :header-cell-style="{
          textAlign: 'center',
          background: '#409eff',
          color: '#ffffff',
        }"
      >
        <el-table-column label="设备名称">发泡蜡</el-table-column>
        <el-table-column label="功耗（W）">
          <template slot-scope="scope">
            <el-input v-model.number="scope.row.fplConsumUp"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="保温水温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.warmTempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.warmTempDown"></el-input>
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column label="发泡蜡气压报警(KPA)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.fplPressureUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.fplPressureDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
        <el-table-column label="注蜡管道温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.waxPutTempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.waxPutTempDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
        <el-table-column label="冷却水（入）温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.coldTempInUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.coldTempInDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
        <el-table-column label="冷却水（出）温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.coldTempOutUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.coldTempOutDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
      </el-table>
      <el-table
        :data="tableData2"
        style="width: 100%"
        border
        :cell-style="{ textAlign: 'center' }"
        :header-cell-style="{
          textAlign: 'center',
          background: '#409eff',
          color: '#ffffff',
        }"
      >
        <el-table-column label="设备名称">油化蜡</el-table-column>
        <el-table-column label="油化蜡设备功耗报警上限(W)">
          <template slot-scope="scope">
            <el-input v-model.number="scope.row.yhlConsumUp"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="进油口温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.oilInTempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.oilInTempDwon"></el-input>
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column label="出油口温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.oilOutTempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.oilOutTempDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
        <el-table-column label="1号蜡池温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.waxATempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.waxATempDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
        <el-table-column label="2号蜡池温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.waxBTempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.waxBTempDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
        <el-table-column label="3号蜡池温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.waxCTempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.waxCTempDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
        <el-table-column label="4号蜡池温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.waxDTempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.waxDTempDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
        <el-table-column label="5号蜡池温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.waxETempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.waxETempDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
      </el-table>
      <el-table
        :data="tableData2"
        style="width: 100%"
        border
        :cell-style="{ textAlign: 'center' }"
        :header-cell-style="{
          textAlign: 'center',
          background: '#409eff',
          color: '#ffffff',
        }"
      >
        <el-table-column label="设备名称">制冷</el-table-column>
        <el-table-column label="功耗(W)">
          <template slot-scope="scope">
            <el-input v-model.number="scope.row.zlConsumUp"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="制冷一段温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.zlATempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.zlATempDown"></el-input>
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column label="制冷二段温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.zlBTempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.zlBTempDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
        <el-table-column label="制冷三段温度报警(℃)">
          <el-table-column label="上限">
            <template slot-scope="scope">
              <el-input v-model.number="scope.row.zlCTempUp"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="下限">
            <template slot-scope="scope">
              <el-input
                v-model.number="scope.row.zlCTempDown"
              ></el-input> </template
          ></el-table-column>
        </el-table-column>
      </el-table>
      <el-table
        :data="tableData2"
        style="width: 100%"
        border
        :cell-style="{ textAlign: 'center' }"
        :header-cell-style="{
          textAlign: 'center',
          background: '#409eff',
          color: '#ffffff',
        }"
      >
        <el-table-column label="设备名称">螺旋上线</el-table-column>
        <el-table-column label="螺旋上线功耗(W)">
          <template slot-scope="scope">
            <el-input v-model.number="scope.row.lxsxConsumUp"></el-input>
          </template>
        </el-table-column>
      </el-table>
      <el-table
        :data="tableData2"
        style="width: 100%"
        border
        :cell-style="{ textAlign: 'center' }"
        :header-cell-style="{
          textAlign: 'center',
          background: '#409eff',
          color: '#ffffff',
        }"
      >
        <el-table-column label="设备名称">压柱机A</el-table-column>
        <el-table-column label="压柱机A功耗报警上限(W)">
          <template slot-scope="scope">
            <el-input v-model.number="scope.row.yzjAConsumUp"></el-input>
          </template>
        </el-table-column>
      </el-table>
      <el-table
        :data="tableData2"
        style="width: 100%"
        border
        :cell-style="{ textAlign: 'center' }"
        :header-cell-style="{
          textAlign: 'center',
          background: '#409eff',
          color: '#ffffff',
        }"
      >
        <el-table-column label="设备名称">压柱机B</el-table-column>
        <el-table-column label="压柱机B功耗报警上限(W)">
          <template slot-scope="scope">
            <el-input v-model.number="scope.row.yzjBConsumUp"></el-input>
          </template>
        </el-table-column>
      </el-table>
      <el-table
        :data="tableData2"
        style="width: 100%"
        border
        :cell-style="{ textAlign: 'center' }"
        :header-cell-style="{
          textAlign: 'center',
          background: '#409eff',
          color: '#ffffff',
        }"
      >
        <el-table-column label="设备名称">自动上线</el-table-column>
        <el-table-column label="自动上限能耗报警上限(KWH)">
          <template slot-scope="scope">
            <el-input v-model.number="scope.row.zdsxConsumUp"></el-input>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import { getparamterSet, postparamterSet } from "@/api/system/parameterSet";
export default {
  name: "parameterSet",
  data() {
    return {
      //   form: {
      //     name: "lee",
      //   },
      tableData: {},
      list: [{}],
      tableData2: [],
    };
  },
  mounted() {
    this.getParamterSet();
  },
  methods: {
    handleEdit(index, row) {
      console.log(index, row);
    },
    handleDelete(index, row) {
      console.log(index, row);
    },
    getParamterSet() {
      getparamterSet().then((res) => {
        this.tableData = res.data;
        let table2 = res.data;
        this.tableData2.push(table2);
        console.log(this.tableData2);
      });
    },
    postOne() {
      postparamterSet(this.tableData2[0]).then((res) => {
        console.log(res);
        this.$alert("保存成功", "信息");
      });
    },
  },
};
</script>

<style scoped>
.form {
  margin-left: 40px;
  margin-right: 40px;
  margin-top: 20px;
}
.el-table {
  margin-top: 15px;
}
</style>
